package com.maxd.service.userinfo;
import com.maxd.bean.user.AdjustPromotePointReq;
import com.maxd.error.Result;
import com.maxd.model.LoginInfo;
import com.maxd.model.UserInfo;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;

public interface IUserService {
    /**
     * 获取
     *
     * @return
     */
    Result findAll();

    /**
     * 保存对象
     *
     * @param userInfo
     */
    Result saveBody(UserInfo userInfo);

    /**
     * 获取一个对象
     */
    Result findOne(long id);

    /**
     * 删除一个
     */
    Result delete(long id);


    /**
     * 条件查询
     * <p>
     * 分页
     */
    Result find(String state, Pageable pageable);

    /**
     * 条件查询
     * <p>
     * 分页
     */
    Result findList(Pageable pageable);

    /**
     * 修改
     *
     * @param userInfo 对象
     */
    Result updateBody(UserInfo userInfo);

    /**
     * 获取一个对象
     */
    Result Login(LoginInfo loginInfo);

    /**
     * 获取一个对象
     */
    Result mpUpdateUser(LoginInfo loginInfo);

    UserInfo getUserByPhone(String phone);

    Result getUserByWxId(String wxId);

    Result getUserByRelationId(String relationId);

    Result updateState(String state, String id);

    Result updatePwd(String old, String pwd, String userId);

    Result forgetPwd(String pwd, String phone, String msg);

    Result loginByOpenId(String openid,String relation);
    Result loginByMpId(String openid);
    Result loginByOpenIdWithRelation(String openid, String relation,String unionid);

    Result bindOpenId(String userId, String openId);

    Result loginTb(LoginInfo loginInfo);

    Result loginApp(LoginInfo loginInfo);

    Result bindTaoBao(LoginInfo loginInfo);

    Result sendMsg(String phone, String state);

    Result getUsersByInvitation(String invitation, Pageable pageable);

    Result getInvitation(String invitation);

    Result getCount(String invitation);

    Result getCash(String invitation);

    Result bindOpenid(LoginInfo loginInfo);

    Result LoginAndRegister(LoginInfo loginInfo);

    Result loginAndCode(LoginInfo loginInfo);

    Result loginCode(LoginInfo loginInfo);

    Result loginTaoBao(LoginInfo loginInfo);

    Result loginWeiXinApp(LoginInfo loginInfo);

    Result bindPhone(String userId, String phone, String code);

    Result updatePhone(String phone, String msg, String userId);

    Result bindRelationId(String userId, String relationId);

    Result bindRelationIdCode(String userId, String relationId, String code);

    Result checkRelationInvitations(String invitation, String userOpenid, String phone);

    void  pushToSingle(String title, String content,String clientId);

    //订单支付消息
    void orderPay(Long userId, String orderNum, String payMoney, String createTime);
    //订单取消
    void orderCancel(Long userId, String orderNum, String time);
    //订单发货
    void orderExpress(Long userId, String orderNum, String time, String expressName, String expressNumber, String address);
    //订单退款
    void orderRefund(Long userId, String payMoney);

    void getImg(String page, String scene,String width, HttpServletResponse response);

    String getImagePath(String page, String scene,String width) throws Exception;

    void adjustPromotePoint(AdjustPromotePointReq req);

}
